this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};this.BX.Landing.Ui=this.BX.Landing.Ui||{};this.BX.Landing.Ui.Panel=this.BX.Landing.Ui.Panel||{};this.BX.Landing.Ui.Panel.Formsettingspanel=this.BX.Landing.Ui.Panel.Formsettingspanel||{};(function(e,t,n,i,a,r,s,o){"use strict";var l="/bitrix/js/landing/ui/panel/formsettingspanel/content/header-and-button/dist/images/header-and-buttons-message-icon.svg";function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){babelHelpers.defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var g=function(e){babelHelpers.inherits(o,e);function o(e){var c;babelHelpers.classCallCheck(this,o);c=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(o).call(this,e));c.setEventNamespace("BX.Landing.UI.Panel.FormSettingsPanel.HeaderAndButtonContent");var d=new t.HeaderCard({title:n.Loc.getMessage("LANDING_HEADER_AND_BUTTONS_TITLE")});var g=new i.MessageCard({id:"headerAndButtonMessage",icon:l,header:n.Loc.getMessage("LANDING_HEADER_AND_BUTTONS_MESSAGE_HEADER"),description:n.Loc.getMessage("LANDING_HEADER_AND_BUTTONS_MESSAGE_DESCRIPTION_2"),restoreState:true,more:function e(){var t=n.Reflection.getClass("top.BX.Helper");if(t){BX.Helper.show("redirect=detail&code=12802786")}}});var u=new a.FormSettingsForm({id:"headers",title:n.Loc.getMessage("LANDING_HEADER_AND_BUTTONS_HEADERS_FORM_TITLE"),fields:[new s.VariablesField({selector:"title",title:n.Loc.getMessage("LANDING_HEADER_AND_BUTTONS_HEADERS_FORM_HEADER_FIELD_TITLE"),textOnly:true,content:c.options.formOptions.data.title,variables:c.getPersonalizationVariables()}),new s.VariablesField({selector:"desc",title:n.Loc.getMessage("LANDING_HEADER_AND_BUTTONS_HEADERS_FORM_SUBHEADER_FIELD_TITLE"),textOnly:true,content:c.options.formOptions.data.desc,variables:c.getPersonalizationVariables()}),new BX.Landing.UI.Field.Checkbox({selector:"hideDesc",items:[{value:"hideDesc",name:n.Loc.getMessage("LANDING_HEADER_AND_BUTTONS_HEADERS_FORM_HIDE_SUBHEADER_FIELD_TITLE")}],compact:true})]});var _=new a.FormSettingsForm({id:"buttons",title:n.Loc.getMessage("LANDING_HEADER_AND_BUTTONS_BUTTONS_FORM_TITLE"),fields:[new r.TextField({selector:"buttonCaption",title:n.Loc.getMessage("LANDING_HEADER_AND_BUTTONS_BUTTONS_FORM_SEND_BUTTON_TITLE"),textOnly:true,content:c.options.formOptions.data.buttonCaption})]});c.addItem(d);c.addItem(g);c.addItem(u);c.addItem(_);return c}babelHelpers.createClass(o,[{key:"getPersonalizationVariables",value:function e(){var t=this;return this.cache.remember("personalizationVariables",(function(){return t.options.dictionary.personalization.list.map((function(e){return{name:e.name,value:e.id}}))}))}},{key:"valueReducer",value:function e(t){var n=Object.entries(t).reduce((function(e,t){var n=babelHelpers.slicedToArray(t,2),i=n[0],a=n[1];if(i==="hideDesc"){if(a.includes(i)){e.desc=""}delete e.hideDesc}if(i==="useSign"){e.useSign=a.includes("useSign")}return e}),d({},t));if(!this.items[2].getSwitch().getValue()){n.title="";n.desc=""}return n}},{key:"onChange",value:function e(t){this.emit("onChange",d(d({},t.getData()),{},{skipPrepare:true}))}}]);return o}(o.ContentWrapper);e.default=g})(this.BX.Landing.Ui.Panel.Formsettingspanel.Content=this.BX.Landing.Ui.Panel.Formsettingspanel.Content||{},BX.Landing.UI.Card,BX,BX.Landing.UI.Card,BX.Landing.UI.Form,BX.Landing.UI.Field,BX.Landing.UI.Field,BX.Landing.UI.Panel);
//# sourceMappingURL=header-and-button.bundle.map.js